package select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import neural.Individual;

public class MixRoulette extends Mix{
	
	Roulette r;
	
	public MixRoulette(int eliteSelected){
		super(eliteSelected);
		r = new Roulette();
	}

	@Override
	public List<Individual> getOthers(List<Individual> selected, List<Individual> individuals, int amount) {
		Map<Individual,FitnessValues> fitnessMap = new HashMap<Individual,FitnessValues>();
		Double totalFitness = r.calculateFitness(fitnessMap, individuals);
		r.calculateFrequencies(fitnessMap, totalFitness, individuals);
		return r.selectRandomly(fitnessMap, amount, selected);
	}

}
